import 'package:safetymonitor/generated/json/base/json_convert_content.dart';
import 'package:safetymonitor/app/data/entities/application/risk_point_entity.dart';
import 'package:safetymonitor/app/data/common/choice_bean.dart';


RiskPointEntity $RiskPointEntityFromJson(Map<String, dynamic> json) {
  final RiskPointEntity riskPointEntity = RiskPointEntity();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    riskPointEntity.id = id;
  }
  final int? companyId = jsonConvert.convert<int>(json['companyId']);
  if (companyId != null) {
    riskPointEntity.companyId = companyId;
  }
  final String? riskName = jsonConvert.convert<String>(json['riskName']);
  if (riskName != null) {
    riskPointEntity.riskName = riskName;
  }
  final int? responsibleDeptId = jsonConvert.convert<int>(json['responsibleDeptId']);
  if (responsibleDeptId != null) {
    riskPointEntity.responsibleDeptId = responsibleDeptId;
  }
  final String? responsibleDeptName = jsonConvert.convert<String>(json['responsibleDeptName']);
  if (responsibleDeptName != null) {
    riskPointEntity.responsibleDeptName = responsibleDeptName;
  }
  final int? responsibleUserId = jsonConvert.convert<int>(json['responsibleUserId']);
  if (responsibleUserId != null) {
    riskPointEntity.responsibleUserId = responsibleUserId;
  }
  final String? responsibleUserName = jsonConvert.convert<String>(json['responsibleUserName']);
  if (responsibleUserName != null) {
    riskPointEntity.responsibleUserName = responsibleUserName;
  }
  final int? recognizeDeptId = jsonConvert.convert<int>(json['recognizeDeptId']);
  if (recognizeDeptId != null) {
    riskPointEntity.recognizeDeptId = recognizeDeptId;
  }
  final String? recognizeDeptName = jsonConvert.convert<String>(json['recognizeDeptName']);
  if (recognizeDeptName != null) {
    riskPointEntity.recognizeDeptName = recognizeDeptName;
  }
  final int? recognizeUserId = jsonConvert.convert<int>(json['recognizeUserId']);
  if (recognizeUserId != null) {
    riskPointEntity.recognizeUserId = recognizeUserId;
  }
  final String? recognizeUserName = jsonConvert.convert<String>(json['recognizeUserName']);
  if (recognizeUserName != null) {
    riskPointEntity.recognizeUserName = recognizeUserName;
  }
  final int? longitude = jsonConvert.convert<int>(json['longitude']);
  if (longitude != null) {
    riskPointEntity.longitude = longitude;
  }
  final int? latitude = jsonConvert.convert<int>(json['latitude']);
  if (latitude != null) {
    riskPointEntity.latitude = latitude;
  }
  final int? height = jsonConvert.convert<int>(json['height']);
  if (height != null) {
    riskPointEntity.height = height;
  }
  final String? createTime = jsonConvert.convert<String>(json['createTime']);
  if (createTime != null) {
    riskPointEntity.createTime = createTime;
  }
  return riskPointEntity;
}

Map<String, dynamic> $RiskPointEntityToJson(RiskPointEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['companyId'] = entity.companyId;
  data['riskName'] = entity.riskName;
  data['responsibleDeptId'] = entity.responsibleDeptId;
  data['responsibleDeptName'] = entity.responsibleDeptName;
  data['responsibleUserId'] = entity.responsibleUserId;
  data['responsibleUserName'] = entity.responsibleUserName;
  data['recognizeDeptId'] = entity.recognizeDeptId;
  data['recognizeDeptName'] = entity.recognizeDeptName;
  data['recognizeUserId'] = entity.recognizeUserId;
  data['recognizeUserName'] = entity.recognizeUserName;
  data['longitude'] = entity.longitude;
  data['latitude'] = entity.latitude;
  data['height'] = entity.height;
  data['createTime'] = entity.createTime;
  return data;
}

extension RiskPointEntityExtension on RiskPointEntity {
  RiskPointEntity copyWith({
    int? id,
    int? companyId,
    String? riskName,
    int? responsibleDeptId,
    String? responsibleDeptName,
    int? responsibleUserId,
    String? responsibleUserName,
    int? recognizeDeptId,
    String? recognizeDeptName,
    int? recognizeUserId,
    String? recognizeUserName,
    int? longitude,
    int? latitude,
    int? height,
    String? createTime,
  }) {
    return RiskPointEntity()
      ..id = id ?? this.id
      ..companyId = companyId ?? this.companyId
      ..riskName = riskName ?? this.riskName
      ..responsibleDeptId = responsibleDeptId ?? this.responsibleDeptId
      ..responsibleDeptName = responsibleDeptName ?? this.responsibleDeptName
      ..responsibleUserId = responsibleUserId ?? this.responsibleUserId
      ..responsibleUserName = responsibleUserName ?? this.responsibleUserName
      ..recognizeDeptId = recognizeDeptId ?? this.recognizeDeptId
      ..recognizeDeptName = recognizeDeptName ?? this.recognizeDeptName
      ..recognizeUserId = recognizeUserId ?? this.recognizeUserId
      ..recognizeUserName = recognizeUserName ?? this.recognizeUserName
      ..longitude = longitude ?? this.longitude
      ..latitude = latitude ?? this.latitude
      ..height = height ?? this.height
      ..createTime = createTime ?? this.createTime;
  }
}